package com.woniu.rabbit.routing_model.consumer;

import com.woniu.rabbit.routing_model.exchange_queue_conf.RouteExchangeAndQueueConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class RouteConsumer {
    // 监听 队列1
    @RabbitListener(queues = RouteExchangeAndQueueConfig.QUEUE_NAME01)
    public void routeConsumer01(String msg) {
        log.info("路由模式消费者01接收到消息：{}", msg);
    }

    // 监听队列2
    @RabbitListener(queues = RouteExchangeAndQueueConfig.QUEUE_NAME02)
    public void routeConsumer02(String msg) {
        log.info("路由模式消费者02接收到消息：{}", msg);
    }

}
